package com.pro.service.imple;

import com.pro.mapper.JsMicrocircleCommentMapper;
import com.pro.pojo.JsComment;
import com.pro.pojo.JsMicrocircle;
import com.pro.service.JsMicrocircleCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * ClassName:JsMicrocircleCommentServiceImple
 * Package:com.pro.service.imple
 * Description:
 *
 * @Date:2022/1/18 18:45
 * @Author: XJR
 */
@Service
public class JsMicrocircleCommentServiceImple implements JsMicrocircleCommentService {
    @Autowired
    private JsMicrocircleCommentMapper mapper;

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/1/18
     * @Content:前台按钮微圈数量
     */
    public Integer selectBeforeCountAll(String status,Integer type){
        Integer integer = mapper.selectBeforeCountAll(status, type);
        return integer;
    };

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/1/18
     * @Content:前台table中的数量
     */

    public Integer selectBeforeCountToday(Integer type,String status,String commentDate){
        Integer integer = mapper.selectBeforeCountToday(type, status, commentDate);
        return integer;
    };

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/1/18
     * @Content:前台layuiTable中的数据
     */
    public List<JsComment> selectBeforeTable(Integer type, String status, Integer limit, Integer page){
        page = (page-1)*limit;
        List<JsComment> jsComments = mapper.selectBeforeTable(type, status, limit, page);
        return jsComments;
    };

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/1/18
     * @Content:查看前台用户微圈
     */
    public JsMicrocircle selectBeforeJsMicrocircle(Integer type, Integer id){
        JsMicrocircle jsMicrocircle = mapper.selectBeforeJsMicrocircle(type, id);
        return jsMicrocircle;
    };

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/1/19
     * @Content:通过Id查询前台评论详情
     */
    public List<JsComment> selectBeforeCommentById(Integer commodityId,Integer type){
        List<JsComment> jsComments = mapper.selectBeforeCommentById(commodityId, type);
        return jsComments;
    };

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/1/19
     * @Content:管理人员按钮微圈数量
     */
    public Integer selectUserCountAll(String status,Integer type){
        Integer integer = mapper.selectUserCountAll(status, type);
        return integer;
    };

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/1/18
     * @Content:管理人员table中的数量
     */
    public Integer selectUserCountToday(Integer type,String status,String commentDate){
        Integer integer = mapper.selectUserCountToday(type, status, commentDate);
        return integer;
    };

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/1/19
     * @Content:管理人员layuiTable中的数据
     */
    public List<JsComment> selectUserTable(Integer type,String status,Integer limit,Integer page){
        page = (page-1)*limit;
        List<JsComment> jsComments = mapper.selectUserTable(type, status, limit, page);
        return jsComments;
    };

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/1/19
     * @Content:查看管理人员用户微圈
     */
    public JsMicrocircle selectUserJsMicrocircle(Integer type, Integer id){
        JsMicrocircle jsMicrocircle = mapper.selectUserJsMicrocircle(type, id);
        return jsMicrocircle;
    };

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/1/19
     * @Content:通过Id查询管理人员评论详情
     */
    public List<JsComment> selectUserCommentById(Integer commodityId,Integer type){
        List<JsComment> jsComments = mapper.selectUserCommentById(commodityId, type);
        return jsComments;
    };
}
